
#region copyright notice
//Copyright (c) 2005 Dariush Tasdighi (http://www.IranianExperts.com)
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in
//all copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//THE SOFTWARE.
#endregion


namespace IranianExperts.RSS
{
	public class RSSImage
	{
		private string _uRL = "";
		private string _link = "";
		private string _title = "";
		private string _description = "";

		private int _width = 0;
		private int _height = 0;

		/// <summary>
		/// [Required] - The URL of the image file.
		/// </summary>
		public string URL
		{
			get
			{
				return(_uRL);
			}
			set
			{
				_uRL = value;
			}
		}

		/// <summary>
		/// [Required] - The URL of the site, when the channel is rendered, the image is a link to the site. (Note, in practice the image <title> and <link> should have the same value as the channel's <title> and <link> 
		/// </summary>
		public string Link
		{
			get
			{
				return(_link);
			}
			set
			{
				_link = value;
			}
		}

		/// <summary>
		/// [Required] - Describes the image, it's used in the ALT attribute of the HTML <img> tag when the channel is rendered in HTML.
		/// </summary>
		public string Title
		{
			get
			{
				return(_title);
			}
			set
			{
				_title = value;
			}
		}

		/// <summary>
		/// [Optional] - Text that is included in the TITLE attribute of the link formed around the image in the HTML rendering.
		/// </summary>
		public string Description
		{
			get
			{
				return(_description);
			}
			set
			{
				_description = value;
			}
		}

		/// <summary>
		/// [Optional] - The width of the image in pixels. Default value is 0. Maximum value must be 400.
		/// </summary>
		public int Width
		{
			get
			{
				return(_width);
			}
			set
			{
				if(_width < 400)
					_width = value;
			}
		}

		/// <summary>
		/// [Optional] - The height of the image in pixels. Default value is 0. Maximum value must be 144.
		/// </summary>
		public int Height
		{
			get
			{
				return(_height);
			}
			set
			{
				if(_width < 144)
					_height = value;
			}
		}

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="url"></param>
		/// <param name="link"></param>
		/// <param name="title"></param>
		public RSSImage(string url, string link, string title)
		{
			_uRL = url;
			_link = link;
			_title = title;
		}

		#region Support
		public static string Owner
		{
			get
			{
				return("Dariush Tasdighi - From Tehran, Iran");
			}
		}

		public static string Version
		{
			get
			{
				return("1.0.0");
			}
		}

		public static string Support
		{
			get
			{
				return("Dariush@IranianExperts.com;DariushT@GMail.com;DariushTasdighi@Yahoo.com");
			}
		}

		public static string Homepage
		{
			get
			{
				return("http://www.IranianExperts.com;http://groups.yahoo.com/group/IranianExperts");
			}
		}

		public static string UpdatedDate
		{
			get
			{
				return("14 Feb 2005");
			}
		}
		#endregion
	}
}
